package com.example.jussi.myproject;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import java.io.Serializable;

public class MyDatabase extends SQLiteOpenHelper{
    static String name = "businessCard.db";
    static int version = 1;

    public MyDatabase(Context context) {
        super(context, name, null, version);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        String sql = "create table cards(" +
                "id Integer primary key autoincrement," +
                "business_name varchar(30)," +
                "name varchar(10)," +
                "job varchar(10)," +
                "email varchar(20)," +
                "phone varchar(11)," +
                "qqnumber varchar(15)," +
                "info varchar(200)," +
                "address varchar(100))";
        db.execSQL(sql);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
